
<script type="text/javascript">
	$(function() {
	    $('.search-result-item-wrapper').hover(
	        function(){
				$(this).addClass("owners-operation-background").find(".owners-operation span").show();
	         },
	         function(){
	            $(this).removeClass("owners-operation-background").find(".owners-operation span").hide();
	         }
	     );
	     $("span.left-category-image-thumb").svgallery({'animationSpeed' : 500});
	     
	});
</script>    

<?
	$sess = new Zend_Session_Namespace(CLU_NS);
?>
<body>


<div class="clear"><br/></div>
<h1 style="color:#F48101"> <?=t(140)?></h1>
<? if(isset($this->viewParams['tList']) && count($this->viewParams['tList']) > 0) :?>   

<div style="width:100%;text-align: right;border-bottom:1px solid #d4d4d4;padding-top:5px;padding-bottom:10px" >
	<div style="float:left"> 
		<?=sprintf(t(141),$this->viewParams['numberOfItems'], $this->viewParams['numberOfPages'])?>  
	</div>
	<div style="float:right;width: 300px">
	<?= $this->paginationControl($this->viewParams['paginator'], 'Sliding', '/modules/tour/views/scripts/commonTheme/commonLang/common/pagination_control.phtml'); ?>
	</div>
<div class="clear"></div>
</div>
<!--  Viewing page number X... -->
<div> 
	<?=sprintf(t(142),$this->viewParams['pageNum'] , $this->viewParams['startIndex'], $this->viewParams['startIndex'] + $this->viewParams['perPage'] )?>
</div>

<form id ="bulk-form" action="/en/tour/ajax/bulk-tour" method="POST">

<?$i = 0; ?>

<?foreach ($this->viewParams['tList'] as $tour):?>
<?$i++; ?>
<?$metaData = unserialize($tour['metadata']);?>
		<div class="search-result-item-wrapper">
	    	<div class="search-result-item">
	    		<div class="list-item-index"> 
				<?=$this->viewParams['startIndex'] + $i; ?> 
	    		</div>
	    		
	    		<div class="gallery-content-wrapper">
	    		    <div class="list-item-gallery"> 
	    		    	<span class="left-category-image-thumb">
	    		    		<img src="" class="active-image" />
                         	<span style="display:none" class="image-list"> 
	    		    	
		    			    <?=$this->hvnSlideshow(array('userId' => $tour['poster_id'], 
	    			    						'contentType' => "tour",
	    			    						'contentId' => $tour['id'], 'size' => 'xsmall'
		    			    )) ?>
	    			    </span>
	    		    </div>
    	    		<div class="list-item-content">
	        			<h4 style="margin-top:0px;margin-bottom:0px;padding-top: 4px;padding-bottom:5px">
	        				<a href="<?=$this->hvnUrl(array('module' => 'tour', 'action' => 'view'))?>?id=<?=$tour['id']?>"><?= $this->viewParams['aList'][$tour['id']]['article_title']?></a> (#<?=$tour['id'] ?>)
	        			</h4>
	      				<span class="db-keyword"><?=t(811) ?></span> <?=$tour['price'] ?> <?=$tour['price_currency'] ?> (<span class="db-keyword"><?=t(779)?></span>: <?if(isset($tour['category'])):?><?=p($tour['category']) ?><?endif?>)<br/>
        				 <span class="db-keyword"><?=t(822)?></span>: <?=$tour['itinery'] ?> <br/>
	    				<span class="db-keyword">Travel date:</span> <?=$tour['departure_date'] ?> - <?=$tour['return_date'] ?> (<?=t(813)?>: <b><?= $tour['total_duration'] ?></b> <?=t(826) ?>)<br/>
	    				
	    				<p style="padding-top:0px">
	    		 		 <?$a =str_first_words(strip_tags($this->viewParams['aList'][$tour['id']]['article_body']), 25);?>
				            <?if (strlen($a) > 0) :?>
				            <?=$a ?>
				            <?else:?>
				            <?=t(137) ?>
				        <?endif?>
	    				</p>	
	    			</div>
		    		<div class="list-item-info-bottom">
		    			<img src="/public/themes/prime/images/icon_sao.png"/> <img src="/public/themes/prime/images/icon_sao.png"/> <img src="/public/themes/prime/images/icon_sao.png"/> <img src="/public/themes/prime/images/icon_sao.png"/> <img src="/public/themes/prime/images/icon_sao.png"/> 
                        | <?=t(136)?> <a href="<?=$this->hvnUrl(array('action' => 'view', 'module' => 'user', 'controller' => 'account'),'generic')?>?id=<?=$tour['poster_id']?>" style="text-decoration:none;color:#ff9000;font-weight:bold"><?=$metaData['poster_name'] ?></a> 
	    			</div>
	    		 </div><!--gallery-content-wrapper-->
	    	</div>
	    	<div class="owners-operation"/>
	    		<span style="display:none">
	    			<a style="text-decoration:none" href="<?=$this->hvnUrl(array('module' => 'event', 'action' => 'new'))?>?belong_to_ids=<?=$tour['id']?>&belong_to_names_submit=<?=$tour['name'] ?>"><?=t(221)?></a> |
	    			<a style="text-decoration:none" href="<?=$this->hvnUrl(array('module' => 'tour', 'action' => 'edit'))?>?id=<?=$tour['id']?>"><?=t(135)?></a> |
	    			
			        <? $languages =  Zend_Registry::get('configuration')->languages;?>
	    			<?=t(90)?>: 
	    			<? foreach ($languages as $k=>$v) :?>
                        <? if ($k != $this->viewParams['aList'][$tour['id']]['article_language']) :?> 
                    		<a style="text-decoration:none" href="<?=$this->hvnUrl(array('module' => 'article', 'action' => 'translate'))?>?id=<?=$this->viewParams['aList'][$tour['id']]['article_id']?>&to=<?=$k?>"><?=substr(strstr($v,'_'),1)?></a>,
                    	<?endif?>
                    <?endforeach?>
	    			 | <a style="text-decoration:none"  href="#"> <?=t(32) ?></a>
	    			 
	    			<a style="text-decoration:none;color:red"  href="javascript:void()" name="tour-delete-<?=$tour['id']?>" > [<?=t(31) ?>] </a>
        			<span id="delete-error-<?=$tour['id']?>"></span>
        			
	    		</span>
	    	</div>
	    </div>	<!--search-result-item-wrapper-->
    
<?endforeach?>

<br />

<div> 
	<?=sprintf(t(142),$this->viewParams['pageNum'] , $this->viewParams['startIndex'], $this->viewParams['startIndex'] + $this->viewParams['perPage'] )?>
</div>

<div style="width:100%;text-align: right;border-top:1px solid #d4d4d4;padding-top:5px;padding-bottom:10px" >
	<div style="float:left"> 
		<?=sprintf(t(141),$this->viewParams['numberOfItems'], $this->viewParams['numberOfPages'])?>  
	</div>
	<div style="float:right;width: 300px">
	<?= $this->paginationControl($this->viewParams['paginator'], 'Sliding', '/modules/tour/views/scripts/commonTheme/commonLang/common/pagination_control.phtml'); ?>
	</div>
<div class="clear"></div>
</div>
<!--  Viewing page number X... -->

<div class="clear" ><br/></div>
<div  style="background-color:gray;">
<?=t(30) ?>: 
<select name='bulkaction' id ="bulk" >
<?if(true): //TODO: isadmin()?>
<option value='delete'> <?=t(31) ?> </option>
<?endif ?>
<option value='status'> <?=t(32) ?> </option>
</select>

<select name='changestatus' id ="changeStatus" style=" display:none">
<option value='featured'> <?=t(33) ?> </option>
<option value='published'> <?=t(34) ?> </option>
<option value='queued'> <?=t(35) ?> </option>
<option value='unpublished'> <?=t(36) ?> </option>
<option value='deleted'> <?=t(37) ?> </option>
</select>
<input type="submit" value="Apply" id="bulk-submit" name="bulktour"/>
</div>
</form>
<?else: ?>
<?=sprintf(t(144), t(701)) ?>

<?endif ?>

</body>